package com.chenyongjing.design.pattern.composite.demo.transparent;

/**
 * 透明的组合模式
 */
public class Test {
    public static void main(String[] args) {
        System.out.println("==============透明的组合模式==============");

        CourseComponet pattern = new Course("设计模式模式课程",45.00);
        CourseComponet ai = new Course("人工智能",36.66);

        CourseComponet packageCourse = new CoursePackage("软件架构师",2);

        CourseComponet javaBase = new Course("Java入门",23.00);
        CourseComponet source = new Course("源码分析",26.33);
        packageCourse.addChild(javaBase);
        packageCourse.addChild(source);

        CourseComponet softDesign = new CoursePackage("软件开发",1);
        softDesign.addChild(pattern);
        softDesign.addChild(ai);
        softDesign.addChild(packageCourse);

        softDesign.print();


    }
}
